/*
 * Copyright (C) 2014 Intel Corporation. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __WV_MOD_DRM_ERROR_H_
#define __WV_MOD_DRM_ERROR_H_

// Error codes for the modular Widevine DRM library.
enum drm_wv_mod_result
{
    DRM_WV_MOD_SUCCESS,
    DRM_WV_MOD_ERROR_INIT_FAILED = 0x60000001,
    DRM_WV_MOD_ERROR_TERMINATE_FAILED,
    DRM_WV_MOD_ERROR_SHORT_BUFFER,
    DRM_WV_MOD_ERROR_NO_DEVICE_KEY,
    DRM_WV_MOD_ERROR_KEYBOX_INVALID,
    DRM_WV_MOD_ERROR_NO_KEYDATA,
    DRM_WV_MOD_ERROR_DECRYPT_FAILED,
    DRM_WV_MOD_ERROR_WRITE_KEYBOX,
    DRM_WV_MOD_ERROR_WRAP_KEYBOX,
    DRM_WV_MOD_ERROR_BAD_MAGIC,
    DRM_WV_MOD_ERROR_BAD_CRC,
    DRM_WV_MOD_ERROR_NO_DEVICEID,
    DRM_WV_MOD_ERROR_RNG_FAILED,
    DRM_WV_MOD_ERROR_RNG_NOT_SUPPORTED,
    DRM_WV_MOD_ERROR_OPEN_SESSION_FAILED,
    DRM_WV_MOD_ERROR_CLOSE_SESSION_FAILED,           // 0x10
    DRM_WV_MOD_ERROR_INVALID_SESSION,
    DRM_WV_MOD_ERROR_NOT_IMPLEMENTED,
    DRM_WV_MOD_ERROR_NO_CONTENT_KEY,
    DRM_WV_MOD_ERROR_CONTROL_INVALID,
    DRM_WV_MOD_ERROR_INVALID_CONTEXT,
    DRM_WV_MOD_ERROR_SIGNATURE_FAILURE,
    DRM_WV_MOD_ERROR_DEVICE_NOT_RSA_PROVISIONED,
    DRM_WV_MOD_ERROR_INVALID_RSA_KEY,
    DRM_WV_MOD_ERROR_INVALID_NONCE,
    DRM_WV_MOD_ERROR_KEY_EXPIRED,
    DRM_WV_MOD_ERROR_TOO_MANY_SESSIONS,
    DRM_WV_MOD_ERROR_TOO_MANY_KEYS,
    DRM_WV_MOD_ERROR_INSUFFICIENT_RESOURCES,
    DRM_WV_MOD_ERROR_INSUFFICIENT_HDCP,
    DRM_WV_MOD_ERROR_UNKNOWN_FAILURE,
    DRM_WV_MOD_ERROR_UNSUPPORTED,                    // 0x20
    DRM_WV_MOD_ERROR_ILLEGAL_PARAMETER,
    DRM_WV_MOD_ERROR_SEP_DRIVER_OPERATION_FAILED,
    DRM_WV_MOD_ENCRYPTION_DECRYPTION_SIZE_INCORRECT,
    DRM_WV_MOD_ERROR_BUFFER_TOO_SMALL,
    DRM_WV_MOD_ERROR_BUFFER_TYPE_INVALID,
    DRM_WV_MOD_ERROR_DATA_SIZE_TOO_LARGE,
    DRM_WV_MOD_ERROR_RETURN_BUFFER_TOO_SMALL,
    DRM_WV_MOD_ERROR_DMA_DATA_SIZE_TOO_LARGE,
    DRM_WV_MOD_ERROR_NONCE_GENERATION_FAILURE,
    DRM_WV_MOD_ERROR_SESSION_NALU_PARSE_FAILURE,
    DRM_WV_MOD_ERROR_CRYPTO_OP_FAILURE,
    DRM_WV_MOD_ERROR_DERIVED_ENCRYPTION_KEY_FAILED,
    DRM_WV_MOD_ERROR_DERIVED_CLIENT_MAC_KEY_FAILED,
    DRM_WV_MOD_ERROR_DERIVED_SERVER_MAC_KEY_FAILED,
    DRM_WV_MOD_ERROR_KEY_DERIVATION_FAILED,
    DRM_WV_MOD_ERROR_INVALID_DATA_FORMAT_VERSION,
    DRM_WV_MOD_ERROR_INVALID_PLAYBACK_STATE,
    DRM_WV_MOD_ERROR_INVALID_SESSION_STATE,
    DRM_WV_MOD_ERROR_INVALID_USAGE_TABLE_GENERATION_NUM,
    DRM_WV_MOD_ERROR_INVALID_USAGE_TABLE_MAGIC
};

#endif
